<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>项目大阶段设置</title>
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/comment.css">
    <!--页面样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/style.css">
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/extended.css">
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
</head>
<body>
<div class="myDataCentere" style="width: 900px;height: 200px">
    <ul>
        <li>
            <label class="layui-form-label">编辑阶段</label>
            <select name="JDlist" id="JDlist">
                <option value="">选择阶段</option>
                <#list JDlist as vo>
                    <#if "${stage.stageNo}" =="${vo.badtCode}">
                        <option value="${vo.badtCode}" selected="true">${vo.badtName}</option>
                    <#else>
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
            <input type="hidden" name="id" id="id" value="${stage.id}">
        </li>
        <li>
            <label class="layui-form-label" style="width: 142px;">编辑项目类型</label>
            <select name="PTYPEList" id="PTYPEList">
                <option value="">选择项目类型</option>
                <#list PTYPEList as vo>
                    <#if "${stage.projectTypeNo}" =="${vo.badtCode}">
                        <option value="${vo.badtCode}" selected="true">${vo.badtName}</option>
                    <#else>
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </li>
    </ul>
</div>

<div style="background-color: white;background-color: white;padding: 10px;text-align: center;position: fixed;bottom: 1px;width: 100%;">
    <button class="layui-btn " lay-filter="submitStage" lay-submit type="button">更新</button>
    <button class="layui-btn layui-btn-primary" type="button" id="close">取消</button>
</div>
</body>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

        $('#close').click(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        form.on('submit(submitStage)', function (data) {
            var projectTypeNo = $('#PTYPEList').val();
            var id = $('#id').val();
            var stageNo = $('#JDlist').val();
            var json = {
                projectTypeNo: projectTypeNo,
                stageNo: stageNo,
                id:id
            }

            layerAjax('/adminManager/jc/updateStage', json, '', function (d) {
                if (d.flag == true) {
                    layer.msg(d.msg, {icon: 1});
                } else {
                    layer.msg(d.msg, {icon: 2});
                }
            });
            return false;
        });
    });
</script>
</html>